﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using AnyGrid.Renderers;
using AnyGrid.Renderers.JqGrid;

namespace AnyGrid.Tests.Renderers
{
    [TestClass]
    public class JavaScriptGeneratorTests
    {
        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void JavaScriptForGrids_should_throw_when_grids_argument_null()
        {
            BaseGridRenderer.RenderJavaScript(null, null);
        }

        [TestMethod]
        public void JavaScriptForGrids_should_return_empty_when_grids_argument_empty()
        {
            var input = new List<GridViewModel>();
            
            var result = BaseGridRenderer.RenderJavaScript(input, null);

            Assert.AreEqual(string.Empty, result);
        }

        private class SortNameWithNoSortSpecifierAttribute
        {
            [Key, ScaffoldColumn(false)]
            public Guid Id { get; set; }
            public string Code { get; set; }
            public string Name { get; set; }
        }
    }
}
